
lst = [1,5,2,7,4,9]

def marget_num(marget_list:list,num:int):

    length = len(marget_list)
    m_list = [ (marget_list[i],marget_list[j])
              for i in range(length-1)
              for j in range(i+1,length)
              if marget_list[i] + marget_list[j] == num ]

    return m_list
print(marget_num(lst,11))

# 实现的不错，双重循环耗费的资源比较大，可以尝试一下使用in操作符来判断